package com.fly.hbn.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fly.hbn.dao.CountryDAO;
import com.fly.hbn.model.Country;
import com.fly.hbn.service.CountryService;

@Service
public class CountryServiceImpl implements CountryService
{
    @Autowired
    CountryDAO countryDao;
    
    /**
     * @return
     */
    @Override
    @Transactional
    public List<Country> getAllCountries()
    {
        return countryDao.getAllCountries();
    }
    
    /**
     * @param id
     * @return
     */
    @Override
    @Transactional
    public Country getCountry(int id)
    {
        return countryDao.getCountry(id);
    }
    
    /**
     * @param country
     */
    @Override
    @Transactional
    public void addCountry(Country country)
    {
        countryDao.addCountry(country);
    }
    
    /**
     * @param country
     */
    @Override
    @Transactional
    public void updateCountry(Country country)
    {
        countryDao.updateCountry(country);
    }
    
    /**
     * @param id
     */
    @Override
    @Transactional
    public void deleteCountry(int id)
    {
        countryDao.deleteCountry(id);
    }
}
